{template '_header'}


 <div class="page-heading"> <h2><i class="fa fa-circle-o"></i>会员增长趋势</h2></div>
     <form action="./index.php"  class="form-horizontal" onsubmit='return checkform()'>
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="ewei_shopv2" />
            <input type="hidden" name="do" value="web" />
            <input type="hidden" name="r"  value="statistics.member_increase" />
            <input type="hidden" name="search" value="1" />
<div class="page-toolbar row m-b-sm m-t-sm">
                            <div class="col-sm-3">
				 
		 <div class="input-group-btn">
			        <button class="btn btn-default btn-sm"  type="button" data-toggle='refresh'><i class='fa fa-refresh'></i></button>
		 </div>		 
                               </div>	
	  
			 
                            <div class="col-sm-7 pull-right">
			 		 
	    <select id='days' name="days" class="form-control input-sm select-sm">
                                <option value="7"  {if $days==7}selected{/if}>最近</option>
                                <option value="7"  {if $days==7}selected{/if}>7天</option>
                                <option value="14"  {if $days==14}selected{/if}>14天</option>
                                <option value="30"  {if $days==30}selected{/if}>30天</option>
                                <option value=""  {if $days==''}selected{/if}>按日期</option>
                            </select>
                        <select id='year' name="year" class="form-control input-sm select-sm">
                        <option value=''>年份</option>
                        {loop $years $y}
                        <option value="{$y['data']}"  {if $y['selected']}selected="selected"{/if}>{$y['data']}年</option>
                        {/loop}
                    </select>
                    <select id='month' name="month" class="form-control input-sm select-sm">
                        <option value=''>月份</option>
                        {loop $months $m}
                        <option value="{$m['data']}"  {if $m['selected']}selected="selected"{/if}>{$m['data']}月</option>
                        {/loop}
                    </select>
                                
				<div class="btn-group btn-group-sm">				 
						
                                     <button class="btn btn-sm btn-primary" type="submit"> 搜索</button>
                                 
                                </div>
								
                            </div>
</div>
  </form>
 
<div class="panel panel-default">
    <div class="panel-heading">趋势图</div>
    <div class="panel-body">
        <div id="container" style="min-width: 800px; height: 400px; margin: 0 auto"></div>  
    </div>
</div>
<script language="javascript" src="{EWEI_SHOPV2_STATIC}js/dist/highcharts/highcharts.js"></script>
<script type="text/javascript">
   
   function checkform(){
 
       if($('#days').val()==''){    
           if($('#year').val()==''){    
               alert('请选择年份!');
               return false;
           }
       }
       return true;
   }
 
      $('#days').change(function(){
            if($(this).val()!=''){ 
                $('#year').val('');
                $('#month').val('').attr('disabled',true);;
            }
          
        })
       $('#year').change(function(){
            if($(this).val()==''){ 
                $('#month').val('').attr('disabled',true);
            }
            else{
                $('#days').val('');
                $('#month').removeAttr('disabled');
            }
        })
        
    $(function () {
   
        
        
        $('#container').highcharts({
        chart: {
            type: 'line'
        },
        title: {
             text: '{$charttitle}',
        },
        subtitle: {
            text: ''
        },
        colors: [
'#0061a5',
'#ff0000'
],
        xAxis: {
            categories: [    {loop $datas $key $row}
                   {if $key>0},{/if}"{$row['date']}"
                   {/loop}]
        },
        yAxis: {
            title: {
                text: '人数'
            },allowDecimals:false
        },
        tooltip: {
            enabled: false,
            formatter: function() {
                return '<b>'+ this.series.name +'</b><br>'+this.x +': '+ this.y +'°C';
            }
        },
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [
            {
               name: '会员',
               data: [
                   {loop $datas $key $row}
                   {if $key>0},{/if}{$row['mcount']}
                   {/loop}
               ]
            } ]
    });
    
});
</script>
{template '_footer'}